﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KipmeHQ;

public partial class Product : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        HeadquarterWSClient service = Application["KipmeHQWS"] as HeadquarterWSClient;
        if (service == null)
        {
            service = new HeadquarterWSClient();
        }
        string productCode = Request.QueryString["code"];
        if (String.IsNullOrEmpty(productCode))
            Response.Redirect("Default.aspx");

        product product = service.getDepartmentProductByCode(productCode);
        lblDescription.Text = String.Format("Description: {0}",product.describe);
        lblName.Text = product.name;
        lblPrice.Text = String.Format("Price: {0} EUR",product.price.ToString());
    }
}